using DXP;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
//15 Work build path
//..\..\..\..\..\ProgramData\Altium\Altium Designer {9ECB9ACE-CA73-4F38-A168-06F712D60A63}\Extensions\SwRI_Tools\
//11 Work build path
//..\..\..\..\..\ProgramData\Altium\Altium Designer {A04C362B-55CF-4275-8DE4-511CDF30518B}\Extensions\SwRI_Tools\
//Work epd path
//C:\Users\rlyne\Dropbox\Altium Extensions\SwRI_Tools

//Home build path
//..\..\..\..\..\ProgramData\Altium\Altium Designer {3204312D-51D9-4BB4-89BC-6078E26BEB8F}\Extensions\SwRI_Tools\
//Home epd path
//C:\Users\Randy\Dropbox\Altium Extensions\SwRI_Tools
namespace CSharpPlugin
{
    public interface IPluginFactory
    {
        object InvokePluginFactory(IClient a);
    }

    [ClassInterface(ClassInterfaceType.None)]
    public class PluginFactory : IPluginFactory
    {
        public object InvokePluginFactory(IClient a)
        {
            SwRIServerModule serverModule = new SwRIServerModule(a, Util.SERVERNAME);

            return serverModule;
        }
    }

    [ClassInterface(ClassInterfaceType.AutoDispatch)]
    public class SwRIServerModule : ServerModule
    {
        public SwRIServerModule(IClient argClient, string argModuleName)
            : base(argClient, argModuleName)
        {
            CreateServerViews();
            ToolsPreferences.Load();
        }

        protected void CreateServerViews()
        {
            ServerPanel serverView = new ServerPanel(new frmTracks(), frmTracks.PanelName, frmTracks.PanelCaption);
            ServerPanel serverView2 = new ServerPanel(new DoFileGen(), DoFileGen.PanelName, DoFileGen.PanelCaption);
            ServerPanel serverView3 = new ServerPanel(new FootprintSelect(), FootprintSelect.PanelName, FootprintSelect.PanelCaption);
            ServerPanel serverView4 = new ServerPanel(new frmViaReplace(), frmViaReplace.PanelName, frmViaReplace.PanelCaption);
            ServerPanel serverView5 = new ServerPanel(new frmPlaceReplicate(), frmPlaceReplicate.PanelName, frmPlaceReplicate.PanelCaption);
            ServerPanel serverView6 = new ServerPanel(new frmResFinder(), frmResFinder.PanelName, frmResFinder.PanelCaption);

            Commands.GlobalHolderPanel = serverView;
            if (serverView != null)
            {
                AddServerView(serverView);
                DXP.GlobalVars.Client.AddServerView(serverView);

                //Load settings from AD.
                ToolsPreferences.Load();
            }

            if (serverView2 != null)
            {
                AddServerView(serverView2);
                DXP.GlobalVars.Client.AddServerView(serverView2);

                //Load settings from AD.
                //ToolsPreferences.Load();
            }

            if (serverView3 != null)
            {
                AddServerView(serverView3);
                DXP.GlobalVars.Client.AddServerView(serverView3);

                //Load settings from AD.
                //ToolsPreferences.Load();
            }

            if (serverView4 != null)
            {
                AddServerView(serverView4);
                DXP.GlobalVars.Client.AddServerView(serverView4);

                //Load settings from AD.
                //ToolsPreferences.Load();
            }

            if (serverView5 != null)
            {
                AddServerView(serverView5);
                DXP.GlobalVars.Client.AddServerView(serverView5);

                //Load settings from AD.
                //ToolsPreferences.Load();
            }

            if (serverView6 != null)
            {
                AddServerView(serverView6);
                DXP.GlobalVars.Client.AddServerView(serverView6);

                //Load settings from AD.
                //ToolsPreferences.Load();
            }
        }

        // For addon servers, there is no need to create documents.
        protected override IServerDocument NewDocumentInstance(string argKind, string argFileName)
        {
            return null;
        }

        #region Command related code.
        protected override void InitializeCommands()
        {
            //Autogenerated code. Commands registration. Begin
		((CommandLauncher)CommandLauncher).RegisterCommand("HighlightSelectedNets", this.Command_HighlightSelectedNets, this.GetState_HighlightSelectedNets);
		((CommandLauncher)CommandLauncher).RegisterCommand("MatchRefDesRotation", this.Command_MatchRefDesRotation, this.GetState_MatchRefDesRotation);
		((CommandLauncher)CommandLauncher).RegisterCommand("HideSelectedNets", this.Command_HideSelectedNets, this.GetState_HideSelectedNets);
		((CommandLauncher)CommandLauncher).RegisterCommand("FixPDF", this.Command_FixPDF, this.GetState_FixPDF);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ResFinder", this.Command_ResFinder, this.GetState_ResFinder);
            ((CommandLauncher)CommandLauncher).RegisterCommand("PlaceReplicate", this.Command_PlaceReplicate, this.GetState_PlaceReplicate);
            //((CommandLauncher)CommandLauncher).RegisterCommand("Help", this.Command_Help, this.GetState_Help);
            ((CommandLauncher)CommandLauncher).RegisterCommand("RefdesReport", this.Command_RefdesReport, this.GetState_RefdesReport);
            ((CommandLauncher)CommandLauncher).RegisterCommand("DocGrouping", this.Command_DocGrouping, this.GetState_DocGrouping);
            ((CommandLauncher)CommandLauncher).RegisterCommand("LayerStackup", this.Command_LayerStackup, this.GetState_LayerStackup);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ShowSelectedNets", this.Command_ShowSelectedNets, this.GetState_ShowSelectedNets);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ViaReplace", this.Command_ViaReplace, this.GetState_ViaReplace);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ComponentDensity", this.Command_ComponentDensity, this.GetState_ComponentDensity);
            ((CommandLauncher)CommandLauncher).RegisterCommand("DownloadDatasheets", this.Command_DownloadDatasheets, this.GetState_DownloadDatasheets);
            ((CommandLauncher)CommandLauncher).RegisterCommand("FootprintCompare", this.Command_FootprintCompare, this.GetState_FootprintCompare);
            ((CommandLauncher)CommandLauncher).RegisterCommand("AssignNet", this.Command_AssignNet, this.GetState_AssignNet);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ToggleLoopRemoval", this.Command_ToggleLoopRemoval, this.GetState_ToggleLoopRemoval);
            ((CommandLauncher)CommandLauncher).RegisterCommand("OpenSchematics", this.Command_OpenSchematics, this.GetState_OpenSchematics);
            ((CommandLauncher)CommandLauncher).RegisterCommand("FixRefDesRotation", this.Command_FixRefDesRotation, this.GetState_FixRefDesRotation);
            ((CommandLauncher)CommandLauncher).RegisterCommand("PIMS", this.Command_PIMS, this.GetState_PIMS);
            ((CommandLauncher)CommandLauncher).RegisterCommand("CSEnable", this.Command_CSEnable, this.GetState_CSEnable);
            ((CommandLauncher)CommandLauncher).RegisterCommand("CSMasking", this.Command_CSMasking, this.GetState_CSMasking);
            ((CommandLauncher)CommandLauncher).RegisterCommand("CSZoom", this.Command_CSZoom, this.GetState_CSZoom);
            ((CommandLauncher)CommandLauncher).RegisterCommand("CSReposistion", this.Command_CSReposistion, this.GetState_CSReposistion);
            ((CommandLauncher)CommandLauncher).RegisterCommand("CSFocus", this.Command_CSFocus, this.GetState_CSFocus);
            ((CommandLauncher)CommandLauncher).RegisterCommand("CSComponents", this.Command_CSComponents, this.GetState_CSComponents);
            ((CommandLauncher)CommandLauncher).RegisterCommand("CSNets", this.Command_CSNets, this.GetState_CSNets);
            ((CommandLauncher)CommandLauncher).RegisterCommand("CSPins", this.Command_CSPins, this.GetState_CSPins);
            ((CommandLauncher)CommandLauncher).RegisterCommand("DoReport", this.Command_DoReport, this.GetState_DoReport);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ExportRules", this.Command_ExportRules, this.GetState_ExportRules);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ExportxSignal", this.Command_ExportxSignal, this.GetState_ExportxSignal);
            ((CommandLauncher)CommandLauncher).RegisterCommand("OpenDesignNotes", this.Command_OpenDesignNotes, this.GetState_OpenDesignNotes);
            ((CommandLauncher)CommandLauncher).RegisterCommand("VariantBOM", this.Command_VariantBOM, this.GetState_VariantBOM);
            ((CommandLauncher)CommandLauncher).RegisterCommand("VarFootprintSelect", this.Command_VarFootprintSelect, this.GetState_VarFootprintSelect);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ExportVariant", this.Command_ExportVariant, this.GetState_ExportVariant);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ImportVariant", this.Command_ImportVariant, this.GetState_ImportVariant);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ResetPartRefDesOnPaste", this.Command_ResetPartRefDesOnPaste, this.GetState_ResetPartRefDesOnPaste);
            ((CommandLauncher)CommandLauncher).RegisterCommand("SyncVariant", this.Command_SyncVariant, this.GetState_SyncVariant);
            ((CommandLauncher)CommandLauncher).RegisterCommand("SetActiveLayer", this.Command_SetActiveLayer, this.GetState_SetActiveLayer);
            ((CommandLauncher)CommandLauncher).RegisterCommand("HeightReport", this.Command_HeightReport, this.GetState_HeightReport);
            ((CommandLauncher)CommandLauncher).RegisterCommand("TrackUtil", this.Command_TrackUtil, this.GetState_TrackUtil);
            ((CommandLauncher)CommandLauncher).RegisterCommand("AdjustGridSnap", this.Command_AdjustGridSnap, this.GetState_AdjustGridSnap);
            ((CommandLauncher)CommandLauncher).RegisterCommand("BatchOutjob", this.Command_BatchOutjob, this.GetState_BatchOutjob);
            ((CommandLauncher)CommandLauncher).RegisterCommand("Test", this.Command_Test, this.GetState_Test);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ToggleDesignRule", this.Command_ToggleDesignRule, this.GetState_ToggleDesignRule);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ToggleLockedObjects", this.Command_ToggleLockedObjects, this.GetState_ToggleLockedObjects);
            ((CommandLauncher)CommandLauncher).RegisterCommand("ShowHideRefDes", this.Command_ShowHideRefDes, this.GetState_ShowHideRefDes);
            ((CommandLauncher)CommandLauncher).RegisterCommand("FixEmbededResistors", this.Command_FixEmbededResistors, this.GetState_FixEmbededResistors);
            ((CommandLauncher)CommandLauncher).RegisterCommand("OpenExtFile", this.Command_OpenExtFile, this.GetState_OpenExtFile);
            //Autogenerated code. Commands registration. End
        }

        //Autogenerated code. Commands definition. Begin
		//Autogenerated code. Begin of definition [GetState_HighlightSelectedNets]
		private void GetState_HighlightSelectedNets(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_HighlightSelectedNets(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
		//Autogenerated code. End of definition [GetState_HighlightSelectedNets]

		//Autogenerated code. Begin of definition [Command_HighlightSelectedNets]
		private void Command_HighlightSelectedNets(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_HighlightSelectedNets(argView, ref argParameters);
            return;
        }
		//Autogenerated code. End of definition [Command_HighlightSelectedNets]

		//Autogenerated code. Begin of definition [GetState_MatchRefDesRotation]
		private void GetState_MatchRefDesRotation(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_MatchRefDesRotation(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
		//Autogenerated code. End of definition [GetState_MatchRefDesRotation]

		//Autogenerated code. Begin of definition [Command_MatchRefDesRotation]
		private void Command_MatchRefDesRotation(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_MatchRefDesRotation(argView, ref argParameters);
            return;
        }
		//Autogenerated code. End of definition [Command_MatchRefDesRotation]

		//Autogenerated code. Begin of definition [GetState_HideSelectedNets]
		private void GetState_HideSelectedNets(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_HideSelectedNets(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
		//Autogenerated code. End of definition [GetState_HideSelectedNets]

		//Autogenerated code. Begin of definition [Command_HideSelectedNets]
		private void Command_HideSelectedNets(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_HideSelectedNets(argView, ref argParameters);
            return;
        }
		//Autogenerated code. End of definition [Command_HideSelectedNets]

		//Autogenerated code. Begin of definition [GetState_FixPDF]
		private void GetState_FixPDF(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_FixPDF(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
		//Autogenerated code. End of definition [GetState_FixPDF]

		//Autogenerated code. Begin of definition [Command_FixPDF]
		private void Command_FixPDF(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_FixPDF(argView, ref argParameters);
            return;
        }
		//Autogenerated code. End of definition [Command_FixPDF]

        //Autogenerated code. Begin of definition [GetState_ResFinder]
        private void GetState_ResFinder(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ResFinder(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ResFinder]

        //Autogenerated code. Begin of definition [Command_ResFinder]
        private void Command_ResFinder(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ResFinder(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ResFinder]

        //Autogenerated code. Begin of definition [GetState_PlaceReplicate]
        private void GetState_PlaceReplicate(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_PlaceReplicate(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_PlaceReplicate]

        //Autogenerated code. Begin of definition [Command_PlaceReplicate]
        private void Command_PlaceReplicate(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_PlaceReplicate(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_PlaceReplicate]

        ////Autogenerated code. Begin of definition [GetState_Help]
        //private void GetState_Help(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        //{
        //    new Commands().GetState_Help(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
        //    return;
        //}
        ////Autogenerated code. End of definition [GetState_Help]

        ////Autogenerated code. Begin of definition [Command_Help]
        //private void Command_Help(IServerDocumentView argView, ref string argParameters)
        //{
        //    new Commands().Command_Help(argView, ref argParameters);
        //    return;
        //}
        ////Autogenerated code. End of definition [Command_Help]

        //Autogenerated code. Begin of definition [GetState_RefdesReport]
        private void GetState_RefdesReport(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_RefdesReport(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_RefdesReport]

        //Autogenerated code. Begin of definition [Command_RefdesReport]
        private void Command_RefdesReport(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_RefdesReport(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_RefdesReport]

        //Autogenerated code. Begin of definition [GetState_DocGrouping]
        private void GetState_DocGrouping(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_DocGrouping(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_DocGrouping]

        //Autogenerated code. Begin of definition [Command_DocGrouping]
        private void Command_DocGrouping(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_DocGrouping(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_DocGrouping]

        //Autogenerated code. Begin of definition [GetState_LayerStackup]
        private void GetState_LayerStackup(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_LayerStackup(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_LayerStackup]

        //Autogenerated code. Begin of definition [Command_LayerStackup]
        private void Command_LayerStackup(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_LayerStackup(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_LayerStackup]


        //Autogenerated code. Begin of definition [GetState_ShowSelectedNets]
        private void GetState_ShowSelectedNets(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ShowSelectedNets(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ShowSelectedNets]

        //Autogenerated code. Begin of definition [Command_ShowSelectedNets]
        private void Command_ShowSelectedNets(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ShowSelectedNets(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ShowSelectedNets]

        //Autogenerated code. Begin of definition [GetState_ViaReplace]
        private void GetState_ViaReplace(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ViaReplace(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ViaReplace]

        //Autogenerated code. Begin of definition [Command_ViaReplace]
        private void Command_ViaReplace(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ViaReplace(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ViaReplace]

        //Autogenerated code. Begin of definition [GetState_ComponentDensity]
        private void GetState_ComponentDensity(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ComponentDensity(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ComponentDensity]

        //Autogenerated code. Begin of definition [Command_ComponentDensity]
        private void Command_ComponentDensity(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ComponentDensity(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ComponentDensity]

        //Autogenerated code. Begin of definition [GetState_DownloadDatasheets]
        private void GetState_DownloadDatasheets(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_DownloadDatasheets(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_DownloadDatasheets]

        //Autogenerated code. Begin of definition [Command_DownloadDatasheets]
        private void Command_DownloadDatasheets(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_DownloadDatasheets(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_DownloadDatasheets]

        //Autogenerated code. Begin of definition [GetState_FootprintCompare]
        private void GetState_FootprintCompare(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_FootprintCompare(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_FootprintCompare]

        //Autogenerated code. Begin of definition [Command_FootprintCompare]
        private void Command_FootprintCompare(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_FootprintCompare(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_FootprintCompare]

        //Autogenerated code. Begin of definition [GetState_AssignNet]
        private void GetState_AssignNet(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_AssignNet(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_AssignNet]

        //Autogenerated code. Begin of definition [Command_AssignNet]
        private void Command_AssignNet(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_AssignNet(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_AssignNet]

        //Autogenerated code. Begin of definition [GetState_ToggleLoopRemoval]
        private void GetState_ToggleLoopRemoval(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ToggleLoopRemoval(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ToggleLoopRemoval]

        //Autogenerated code. Begin of definition [Command_ToggleLoopRemoval]
        private void Command_ToggleLoopRemoval(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ToggleLoopRemoval(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ToggleLoopRemoval]

        //Autogenerated code. Begin of definition [GetState_OpenSchematics]
        private void GetState_OpenSchematics(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_OpenSchematics(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_OpenSchematics]

        //Autogenerated code. Begin of definition [Command_OpenSchematics]
        private void Command_OpenSchematics(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_OpenSchematics(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_OpenSchematics]

        //Autogenerated code. Begin of definition [GetState_FixRefDesRotation]
        private void GetState_FixRefDesRotation(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_FixRefDesRotation(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_FixRefDesRotation]

        //Autogenerated code. Begin of definition [Command_FixRefDesRotation]
        private void Command_FixRefDesRotation(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_FixRefDesRotation(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_FixRefDesRotation]

        //Autogenerated code. Begin of definition [GetState_PIMS]
        private void GetState_PIMS(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_PIMS(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_PIMS]

        //Autogenerated code. Begin of definition [Command_PIMS]
        private void Command_PIMS(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_PIMS(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_PIMS]

        //Autogenerated code. Begin of definition [GetState_CSEnable]
        private void GetState_CSEnable(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_CSEnable(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_CSEnable]

        //Autogenerated code. Begin of definition [Command_CSEnable]
        private void Command_CSEnable(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_CSEnable(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_CSEnable]

        //Autogenerated code. Begin of definition [GetState_CSMasking]
        private void GetState_CSMasking(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_CSMasking(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_CSMasking]

        //Autogenerated code. Begin of definition [Command_CSMasking]
        private void Command_CSMasking(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_CSMasking(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_CSMasking]

        //Autogenerated code. Begin of definition [GetState_CSZoom]
        private void GetState_CSZoom(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_CSZoom(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_CSZoom]

        //Autogenerated code. Begin of definition [Command_CSZoom]
        private void Command_CSZoom(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_CSZoom(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_CSZoom]

        //Autogenerated code. Begin of definition [GetState_CSReposistion]
        private void GetState_CSReposistion(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_CSReposistion(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_CSReposistion]

        //Autogenerated code. Begin of definition [Command_CSReposistion]
        private void Command_CSReposistion(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_CSReposistion(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_CSReposistion]

        //Autogenerated code. Begin of definition [GetState_CSFocus]
        private void GetState_CSFocus(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_CSFocus(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_CSFocus]

        //Autogenerated code. Begin of definition [Command_CSFocus]
        private void Command_CSFocus(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_CSFocus(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_CSFocus]

        //Autogenerated code. Begin of definition [GetState_CSComponents]
        private void GetState_CSComponents(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_CSComponents(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_CSComponents]

        //Autogenerated code. Begin of definition [Command_CSComponents]
        private void Command_CSComponents(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_CSComponents(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_CSComponents]

        //Autogenerated code. Begin of definition [GetState_CSNets]
        private void GetState_CSNets(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_CSNets(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_CSNets]

        //Autogenerated code. Begin of definition [Command_CSNets]
        private void Command_CSNets(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_CSNets(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_CSNets]

        //Autogenerated code. Begin of definition [GetState_CSPins]
        private void GetState_CSPins(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_CSPins(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_CSPins]

        //Autogenerated code. Begin of definition [Command_CSPins]
        private void Command_CSPins(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_CSPins(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_CSPins]

        //Autogenerated code. Begin of definition [GetState_DoReport]
        private void GetState_DoReport(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_DoReport(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_DoReport]

        //Autogenerated code. Begin of definition [Command_DoReport]
        private void Command_DoReport(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_DoReport(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_DoReport]

        //Autogenerated code. Begin of definition [GetState_ExportRules]
        private void GetState_ExportRules(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ExportRules(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ExportRules]

        //Autogenerated code. Begin of definition [Command_ExportRules]
        private void Command_ExportRules(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ExportRules(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ExportRules]

        //Autogenerated code. Begin of definition [GetState_ExportxSignal]
        private void GetState_ExportxSignal(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ExportxSignal(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ExportxSignal]

        //Autogenerated code. Begin of definition [Command_ExportxSignal]
        private void Command_ExportxSignal(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ExportxSignal(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ExportxSignal]

        //Autogenerated code. Begin of definition [GetState_OpenDesignNotes]
        private void GetState_OpenDesignNotes(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_OpenDesignNotes(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_OpenDesignNotes]

        //Autogenerated code. Begin of definition [Command_OpenDesignNotes]
        private void Command_OpenDesignNotes(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_OpenDesignNotes(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_OpenDesignNotes]

        //Autogenerated code. Begin of definition [GetState_VariantBOM]
        private void GetState_VariantBOM(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_VariantBOM(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_VariantBOM]

        //Autogenerated code. Begin of definition [Command_VariantBOM]
        private void Command_VariantBOM(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_VariantBOM(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_VariantBOM]

        //Autogenerated code. Begin of definition [GetState_VarFootprintSelect]
        private void GetState_VarFootprintSelect(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_VarFootprintSelect(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_VarFootprintSelect]

        //Autogenerated code. Begin of definition [Command_VarFootprintSelect]
        private void Command_VarFootprintSelect(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_VarFootprintSelect(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_VarFootprintSelect]

        //Autogenerated code. Begin of definition [GetState_ExportVariant]
        private void GetState_ExportVariant(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ExportVariant(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ExportVariant]

        //Autogenerated code. Begin of definition [Command_ExportVariant]
        private void Command_ExportVariant(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ExportVariant(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ExportVariant]

        //Autogenerated code. Begin of definition [GetState_ImportVariant]
        private void GetState_ImportVariant(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ImportVariant(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ImportVariant]

        //Autogenerated code. Begin of definition [Command_ImportVariant]
        private void Command_ImportVariant(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ImportVariant(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ImportVariant]

        //Autogenerated code. Begin of definition [GetState_ResetPartRefDesOnPaste]
        private void GetState_ResetPartRefDesOnPaste(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ResetPartRefDesOnPaste(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ResetPartRefDesOnPaste]

        //Autogenerated code. Begin of definition [Command_ResetPartRefDesOnPaste]
        private void Command_ResetPartRefDesOnPaste(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ResetPartRefDesOnPaste(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ResetPartRefDesOnPaste]

        //Autogenerated code. Begin of definition [GetState_SyncVariant]
        private void GetState_SyncVariant(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_SyncVariant(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_SyncVariant]

        //Autogenerated code. Begin of definition [Command_SyncVariant]
        private void Command_SyncVariant(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_SyncVariant(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_SyncVariant]

        //Autogenerated code. Begin of definition [GetState_SetActiveLayer]
        private void GetState_SetActiveLayer(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_SetActiveLayer(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_SetActiveLayer]

        //Autogenerated code. Begin of definition [Command_SetActiveLayer]
        private void Command_SetActiveLayer(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_SetActiveLayer(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_SetActiveLayer]

        //Autogenerated code. Begin of definition [GetState_HeightReport]
        private void GetState_HeightReport(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_HeightReport(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_HeightReport]

        //Autogenerated code. Begin of definition [Command_HeightReport]
        private void Command_HeightReport(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_HeightReport(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_HeightReport]

        //Autogenerated code. Begin of definition [GetState_TrackUtil]
        private void GetState_TrackUtil(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_TrackUtil(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_TrackUtil]

        //Autogenerated code. Begin of definition [Command_TrackUtil]
        private void Command_TrackUtil(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_TrackUtil(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_TrackUtil]

        //Autogenerated code. Begin of definition [GetState_AdjustGridSnap]
        private void GetState_AdjustGridSnap(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_AdjustGridSnap(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_AdjustGridSnap]

        //Autogenerated code. Begin of definition [Command_AdjustGridSnap]
        private void Command_AdjustGridSnap(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_AdjustGridSnap(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_AdjustGridSnap]

        //Autogenerated code. Begin of definition [GetState_BatchOutjob]
        private void GetState_BatchOutjob(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_BatchOutjob(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_BatchOutjob]

        //Autogenerated code. Begin of definition [Command_BatchOutjob]
        private void Command_BatchOutjob(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_BatchOutjob(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_BatchOutjob]

        //Autogenerated code. Begin of definition [GetState_Test]
        private void GetState_Test(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_Test(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_Test]

        //Autogenerated code. Begin of definition [Command_Test]
        private void Command_Test(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_Test(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_Test]

        //Autogenerated code. Begin of definition [GetState_ToggleDesignRule]
        private void GetState_ToggleDesignRule(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ToggleDesignRule(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ToggleDesignRule]

        //Autogenerated code. Begin of definition [Command_ToggleDesignRule]
        private void Command_ToggleDesignRule(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ToggleDesignRule(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ToggleDesignRule]

        //Autogenerated code. Begin of definition [GetState_ToggleLockedObjects]
        private void GetState_ToggleLockedObjects(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ToggleLockedObjects(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ToggleLockedObjects]

        //Autogenerated code. Begin of definition [Command_ToggleLockedObjects]
        private void Command_ToggleLockedObjects(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ToggleLockedObjects(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ToggleLockedObjects]

        //Autogenerated code. Begin of definition [GetState_ShowHideRefDes]
        private void GetState_ShowHideRefDes(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_ShowHideRefDes(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_ShowHideRefDes]

        //Autogenerated code. Begin of definition [Command_ShowHideRefDes]
        private void Command_ShowHideRefDes(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_ShowHideRefDes(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_ShowHideRefDes]

        //Autogenerated code. Begin of definition [GetState_FixEmbededResistors]
        private void GetState_FixEmbededResistors(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_FixEmbededResistors(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_FixEmbededResistors]

        //Autogenerated code. Begin of definition [Command_FixEmbededResistors]
        private void Command_FixEmbededResistors(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_FixEmbededResistors(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_FixEmbededResistors]

        //Autogenerated code. Begin of definition [GetState_OpenExtFile]
        private void GetState_OpenExtFile(IServerDocumentView argContext, ref string argParameters, ref bool argEnabled, ref bool argChecked, ref bool argVisible, ref string argCaption, ref string argImageFile)
        {
            new Commands().GetState_OpenExtFile(argContext, ref argParameters, ref argEnabled, ref argChecked, ref argVisible, ref argCaption, ref argImageFile);
            return;
        }
        //Autogenerated code. End of definition [GetState_OpenExtFile]

        //Autogenerated code. Begin of definition [Command_OpenExtFile]
        private void Command_OpenExtFile(IServerDocumentView argView, ref string argParameters)
        {
            new Commands().Command_OpenExtFile(argView, ref argParameters);
            return;
        }
        //Autogenerated code. End of definition [Command_OpenExtFile]


        //Autogenerated code. Commands definition. End
        #endregion

        /// <summary>
        /// Registers the option pages with AD.
        /// </summary>
        protected override void RegisterOptionsPages()
        {
            //RegisterOptionsPageCreator("PCB", CreateOptionsPage_PCB); //PCB options page
            //RegisterOptionsPageCreator("SCH", CreateOptionsPage_SCH); //SCH options page
            RegisterOptionsPageCreator("General", CreateOptionsPage_General); //General options page
        }

        ///// <summary>
        ///// Loads PCB options form.
        ///// </summary>
        ///// <returns></returns>
        //private IOptionsPage CreateOptionsPage_PCB()
        //{
        //    return new OptionsPage(new PCB_Options());
        //}

        ///// <summary>
        ///// Loads SCH options form.
        ///// </summary>
        ///// <returns></returns>
        //private IOptionsPage CreateOptionsPage_SCH()
        //{
        //    return new OptionsPage(new SCH_Options());
        //}

        /// <summary>
        /// Loads General options form.
        /// </summary>
        /// <returns></returns>
        private IOptionsPage CreateOptionsPage_General()
        {
            return new OptionsPage(new General_Options());
        }

        /// <summary>
        /// Recieves notification messages from AD with the unique ID of the server process.
        /// </summary>
        /// <param name="argNotification"></param>
        protected override void ReceiveNotificationImpl(INotification argNotification)
        {
            //Verify system notitifcation for our server process.
            if (NotificationType.SystemNotification.Equals(argNotification.GetNotificationType(), StringComparison.OrdinalIgnoreCase)
                    && argNotification.GetNotificationCode() == ToolsPreferences.NotificationCodePreferencesChanged)
            {
                this.UpdateControlsFromNotification(argNotification);
            }
            //else if (NotificationType.DocumentNotification.Equals(argNotification.GetNotificationType(), StringComparison.OrdinalIgnoreCase)
            //    && argNotification.GetNotificationCode() == NotificationCode.DocumentNotificationCode.DocumentClosing)
            //{
            //    _Log.Debug(argNotification.GetNotificationCode());

            //    //this.UpdateControlsFromNotification(argNotification);
            //}
            //NotificationCode
//#if DEBUG
            //List<string> Output = new List<string>();

            //try
            //{
            //    switch (argNotification.GetNotificationType())
            //    {
            //        case NotificationType.DocumentFormNotification:
            //            //Code: 0
            //            //*Code: 1
            //            switch (argNotification.GetNotificationCode())
            //            {
            //                case NotificationCode.DocumentFormNotificationCode.DocumentFormActivated:
            //                    break;
            //                case NotificationCode.DocumentFormNotificationCode.DocumentFormDeActivated:
            //                    break;
            //                default:
            //                    break;
            //            }
            //            break;
            //        case NotificationType.DocumentNotification:
            //            //Code: 36
            //            //Code: 0
            //            //Code: 99
            //            //Code: 7
            //            //Code: 6
            //            //Code: 100
            //            //Code: 51
            //            IDXPDocument DXPDoc;
            //            IServerDocument ServerDoc;
            //            //switch (argNotification.GetNotificationCode())
            //            //{
            //            //    case NotificationCode.DocumentNotificationCode.DocumentCreated:
            //            //        Output.Add("DocumentCreated");
            //            //        DXPDoc = argNotification.GetNotificationData() as IDXPDocument;
            //            //        ServerDoc = argNotification.GetNotificationData() as IServerDocument;
            //            //        if (DXPDoc == null || ServerDoc == null) break;
            //            //        Output.Add("DXP Doc Kind: " + DXPDoc.DM_DocumentKind());
            //            //        Output.Add("DXP Doc filename: " + DXPDoc.DM_FileName());
            //            //        Output.Add("Server Doc Kind: " + ServerDoc.GetKind());
            //            //        Output.Add("Server Doc filename: " + ServerDoc.GetFileName());
            //            //        break;
            //            //    case NotificationCode.DocumentNotificationCode.DocumentLoading:
            //            //        Output.Add("DocumentLoading");
            //            //        DXPDoc = argNotification.GetNotificationData() as IDXPDocument;
            //            //        ServerDoc = argNotification.GetNotificationData() as IServerDocument;
            //            //        Output.Add("DXP Doc Kind: " + DXPDoc.DM_DocumentKind().ToString());
            //            //        Output.Add("DXP Doc filename: " + DXPDoc.DM_FileName().ToString());
            //            //        Output.Add("Server Doc Kind: " + ServerDoc.GetKind().ToString());
            //            //        Output.Add("Server Doc filename: " + ServerDoc.GetFileName().ToString());
            //            //        break;
            //            //    case 99:
            //            //        Output.Add("99");
            //            //        DXPDoc = argNotification.GetNotificationData() as IDXPDocument;
            //            //        ServerDoc = argNotification.GetNotificationData() as IServerDocument;
            //            //        Output.Add("DXP Doc Kind: " + DXPDoc.DM_DocumentKind());
            //            //        Output.Add("DXP Doc filename: " + DXPDoc.DM_FileName());
            //            //        Output.Add("Server Doc Kind: " + ServerDoc.GetKind());
            //            //        Output.Add("Server Doc filename: " + ServerDoc.GetFileName());
            //            //        break;
            //            //    case NotificationCode.DocumentNotificationCode.DocumentCompiling:
            //            //        Output.Add("DocumentCompiling");
            //            //        DXPDoc = argNotification.GetNotificationData() as IDXPDocument;
            //            //        ServerDoc = argNotification.GetNotificationData() as IServerDocument;
            //            //        Output.Add("DXP Doc Kind: " + DXPDoc.DM_DocumentKind());
            //            //        Output.Add("DXP Doc filename: " + DXPDoc.DM_FileName());
            //            //        Output.Add("Server Doc Kind: " + ServerDoc.GetKind());
            //            //        Output.Add("Server Doc filename: " + ServerDoc.GetFileName());
            //            //        break;
            //            //    case NotificationCode.DocumentNotificationCode.DocumentCompiled:
            //            //        Output.Add("DocumentCompiled");
            //            //        DXPDoc = argNotification.GetNotificationData() as IDXPDocument;
            //            //        ServerDoc = argNotification.GetNotificationData() as IServerDocument;
            //            //        Output.Add("DXP Doc Kind: " + DXPDoc.DM_DocumentKind());
            //            //        Output.Add("DXP Doc filename: " + DXPDoc.DM_FileName());
            //            //        Output.Add("Server Doc Kind: " + ServerDoc.GetKind());
            //            //        Output.Add("Server Doc filename: " + ServerDoc.GetFileName());
            //            //        break;
            //            //    case 100:
            //            //        Output.Add("100");
            //            //        DXPDoc = argNotification.GetNotificationData() as IDXPDocument;
            //            //        ServerDoc = argNotification.GetNotificationData() as IServerDocument;
            //            //        Output.Add("DXP Doc Kind: " + DXPDoc.DM_DocumentKind());
            //            //        Output.Add("DXP Doc filename: " + DXPDoc.DM_FileName());
            //            //        Output.Add("Server Doc Kind: " + ServerDoc.GetKind());
            //            //        Output.Add("Server Doc filename: " + ServerDoc.GetFileName());
            //            //        break;
            //            //    case 51:
            //            //        Output.Add("51");
            //            //        DXPDoc = argNotification.GetNotificationData() as IDXPDocument;
            //            //        ServerDoc = argNotification.GetNotificationData() as IServerDocument;
            //            //        Output.Add("DXP Doc Kind: " + DXPDoc.DM_DocumentKind());
            //            //        Output.Add("DXP Doc filename: " + DXPDoc.DM_FileName());
            //            //        Output.Add("Server Doc Kind: " + ServerDoc.GetKind());
            //            //        Output.Add("Server Doc filename: " + ServerDoc.GetFileName());
            //            //        break;
            //            //    default:
            //            //        break;
            //            //}
            //            break;
            //        case NotificationType.MessagesNotification:
            //            //Code: 0
            //            switch (argNotification.GetNotificationCode())
            //            {
            //                case NotificationCode.MessagesNotificationCode.MessagesAdd:
            //                    break;
            //                default:
            //                    break;
            //            }
            //            break;
            //        case NotificationType.SystemNotification:
            //            //Code: 4
            //            switch (argNotification.GetNotificationCode())
            //            {
            //                case NotificationCode.SystemNotificationCode.SchPreferencesChanged:
            //                    break;
            //                default:
            //                    break;
            //            }
            //            break;
            //        default:
            //            Output.Add("Default");
            //            Output.Add("Code: " + argNotification.GetNotificationCode().ToString());
            //            if (argNotification.GetNotificationData() != null) Output.Add("Data: " + argNotification.GetNotificationData().ToString());
            //            Output.Add("Type: " + argNotification.GetNotificationType());
            //            break;
            //    }

            //    Util.AppendLog(Output, "C:\\Users\\rlyne\\Dropbox\\Altium Extensions\\PDF Updater\\log.txt");
            //}
            //catch (Exception)
            //{

            //    //throw;
            //}
//#endif
        }

        /// <summary>
        /// Saves setting changes when "Ok" or "Apply" is clicked in DXP>Preferences.
        /// </summary>
        /// <param name="argNotification"></param>
        private void UpdateControlsFromNotification(INotification argNotification)
        {
            ToolsPreferences.Save();
        }
    }
}

